package cn.ml.chuji.game.shuiXianHuaShu;

//输出所有的水仙花数
//水仙花数：是一个三位数，个位、十位、百位的数字立方和等于原数
public class ShuiXianHuaShu {
    public static void main(String[] args) {

        for (int i = 100; i < 999; i++) {
            int sum;
            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i / 100;
            sum = ge*ge*ge + shi*shi*shi + bai*bai*bai;
            if (sum == i){
                System.out.println("水仙花数为：" + i);
            }
        }
    }
}
